package com.stone.service;

import java.util.List;

import com.stone.model.Stone;
import com.stone.model.Photo;
import com.stone.utils.Page;

public interface IStoneService {
	/**
	 * 
	 * @param stone
	 * @return
	 */
	public void updateStone(Stone stone);
	/**
	 * 
	 * @param stone
	 * @return
	 */
	public Stone addStone(Stone stone);
	/**
	 * 获得最新上传的石材
	 * @param pageno
	 * @param pagesize
	 * @return
	 */
	public Page getNewUploadStones(int pageno, int pagesize);
	/**
	 * 获得浏览最多的石材
	 * @param pageno
	 * @param pagesize
	 * @return
	 */
	public Page getVisitMostStones(int pageno, int pagesize);
	
	public Page getVisitMostDisplayStones(int pageno, int pagesize);
	/**
	 * 
	 * @param stone
	 * @param pageno
	 * @param pagesize
	 * @return
	 */
	public Page searchStoneByNew(Stone stone, int pageno, int pagesize);
	/**
	 * 
	 * @param stone
	 * @param pageno
	 * @param pagesize
	 * @return
	 */
	public Page searchStoneByVisit(Stone stone, int pageno, int pagesize);
	
	public Page searchCompanyByStone(Stone stone,int pageno, int pagesize);
	/**
	 * 
	 * @param stoneId
	 * @return
	 */
	
	public Stone findStoneById(long stoneId);
	
	public void addStonePhoto(Photo photo);
	
	public List<Photo> findPhotosByStoneId(long stoneId);
	/**
	 * @return
	 */
	public boolean createIndex(String path);
	/**
	 * 
	 * @param path
	 * @return
	 */
	public boolean createNewIndex(String path);
	/**
	 * 
	 * @param query
	 * @return
	 */
	public Page getHighSearchStone(String path,String query,int pageno, int pagesize);

	
	/**
	 * 取得所有的石头
	 */
	public List<Stone> getAllStones();
	
	/**
	 * 通过石头的ID 取得这个石头
	 * @param id
	 * @return
	 */
	public Stone getStoneById(Long id);
	
	public Page getStoneList(int pageno, int pagesize);
	
	/**
	 * 根据某名字取得
	 * @param stoneName
	 * @param pageno
	 * @param pagesize
	 * @return
	 */
	public Page findStonePageByName(String stoneName,int pageno,int pagesize);
	
	public Page findStonePageByColor(String category, int pageno, int pagesize);
	
	public Page findStonePageByPurpose(String category, int pageno, int pagesize);
	
	public void deleteStone(Stone s);
	/**
	 * 查找和 @param stone 相似的石材品种。返回 @param size 个结果
	 * @param stone
	 * @param size
	 * @return
	 */
	public List<Stone> getLikelyStones(Stone stone,int size);
	public Photo findPhotosById(long defaultPhotoId);
	public void updatePhoto(Photo p);
	public void deletePhoto(Photo p);
	public int validateName(String chineseName);
	
}
